update platform 3

Documentation Version for Comments and Changes

You are invited to make any changes...add any comments.

Changes will `eventually` be merged into the offical documentation.

Leave any commnents here...

...

... back to index page OE documentation



</eucode>

In this above example, we have constant declarations which are different according to OS such things. The line with FOO has a syntax error but your interpreter will not catch it if you are running Windows. There is no OS with the name 'TRASHOS'. I simply made it up and this construct will not warn you about mistakes like these.

Run-time evalution provides you something that is always syntax-checked and you can even make expressions using comparatives to avoid both parse-time and run-time branching all together.

add_code = { 
    -- first int argument is at stack offset +4, 2nd int is at +8  
       #8B, #44, #24, #04,                  -- mov   eax, +4[esp] 
       #03, #44, #24, #08,                  -- add   eax, +8[esp] 
       #C2, #00, #08 * (platform() = WINDOWS) -- ret 8   
                                            -- pop 8 bytes off the stack 
} 

This is machine code to be put into memory as an example from .../euphoria/demo/callmach.ex. Here if platform() = WINDOWS is true, then the code will pop 8 bytes off of the stack, if not it will pop 0 bytes off of the stack. This has to be done because of where the function call conventions are implemented in the various compilers. We use Watcom C for Windows and GCC for the others. Now if the programmer had put a non-existent symbol, such as ARCH64, the parser would stop, point out the error, and the programmer would then fix it.

The Discontinued DOS32 Platform

This platform is no longer supported.

Those interested in writing DOS programs in Euphoria may use version 3.1 downloadable from the original RapidEuphoria website: http://www.rapideuphoria.com/v20.htm.

The DOS32 platform was for computers without Windows OS, and though people could still use the Euphoria binaries built for this platform on Windows, it was slower than and lacked features available on binaries built for the WINDOWS platform.

The binaries for this platform had support for low-level graphics and though DOS was 16-bit, the Euphoria binaries for DOS32 used techniques that allowed you to use 32-bit addresses transparently, hence the name of the platform: DOS32. However, in this platform you could not use dynamically loaded libraries and filenames had to be in a format of: eight letters, a dot, and three letters when creating a file. You could not use the Windowing system even if your computer had Windows. You were limited to full-sreen mode graphics and the text console.

The Windows Platform

With the Windows platform, your programs can still use the text console. Because most library routines work the same way on each platform most text mode programs can be run using the console interpreter of any platform without any change.

Since the Euphoria interpreter can work directly with your OS you can also create GUI programs. You can use a user submitted library from the archive or handle calls directly into the DLLs. There are high-level graphics libraries for Direct3D and OpenGL available from the Euphoria Web site.

A console window will be created automatically when a Windows Euphoria program first outputs something to the screen or reads from the keyboard. If your program is displaying a screen, you will also see a console window when you read standard input or write to standard output, even when these have been redirected to files. The console

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu